package com.db.williamchart.animation;

import ohos.agp.animation.Animator;

import java.util.List;

public abstract class ChartAnimation<T> {
    private static final long DEFAULT_DURATION = 1000;
    private long duration = DEFAULT_DURATION;
    private int curveType = Animator.CurveType.DECELERATE;

    public abstract ChartAnimation<T> animateFrom(Float startPosition, List<T> entries,ChartCallback chartCallback);

    public long getDuration() {
        return duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }

    public int getCurveType() {
        return curveType;
    }

    public void setCurveType(int curveType) {
        this.curveType = curveType;
    }

    public interface ChartCallback{
        void invoke(Float value);
    }
}
